
#include<nlohmann/json.hpp>
#include<string>
using namespace std;
using json = nlohmann::json;

class User{
    private :
        int user_id;
        string user_name;
        string user_pwd; 
    public :
        User(const int& id,const string& name,const string& pwd):user_id(id),user_name(name),user_pwd(pwd){};
        User()=default;
        User(const json&j):user_id(j["id"]),user_name(j["name"]),user_pwd(j["pwd"]){};
        ~User()=default;

        int get_id()const{return user_id;};
        string get_name()const{return user_name;};
        string get_pwd()const{return user_pwd;};

        void set_name(string name){user_name=name;};
        void set_pwd(string pwd){user_pwd=pwd;};

        json serialize()const;
        void deserialize(const json&j);
};
